#!/bin/sh

source ../public.sh

export PREBUILT=$ANDROID_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86
export PLATFORM=$ANDROID_HOME/platforms/android-8/arch-arm
export ARM_INC=$PLATFORM/usr/include
export ARM_LIB=$PLATFORM/usr/lib
export ARM_LIB2=$PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3
export ARM_CFLAGS="-I$ARM_INC -fPIC -DANDROID"
export ARM_LDFLAGS="-L$FFMPEG_DIR -L$ARM_LIB -L$ARM_LIB2 -nostdlib -lc -lstdc++ -lm -ldl"

export CC=$PREBUILT/bin/arm-linux-androideabi-gcc
export NM=$PREBUILT/bin/arm-linux-androideabi-nm
export CFLAGS="$ARM_CFLAGS"
export LDFLAGS="$ARM_LDFLAGS"

./configure --cross-compile --enable-static --enable-shared --prefix=$DLNA_DIR \
	--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- --with-ffmpeg-dir=$FFMPEG_DIR
